package com.paschino.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.paschino.dao.CategoryDAO;
import com.paschino.modal.Category;

@Service
@Transactional
public class CategoryServiceImpl implements CategoryService {

	@Autowired
	private CategoryDAO categoryDAO;

	@Override
	public boolean addCategory(Category category) {
		return categoryDAO.addCategory(category);
	}

	@Override
	public Category getCategory(int id) {
		return categoryDAO.getCategory(id);
	}

	@Override
	public List<Category> getCategorieList() {
		return categoryDAO.getCategorieList();
	}

	@Override
	public boolean updateCategory(Category category) {
		return categoryDAO.updateCategory(category);
	}

	@Override
	public List<Category> getCategoryListByActive(){
		return categoryDAO.getCategoryListByActive();
	}
	
	@Override
	public int deleteCategory(int cateID) {
		return categoryDAO.deleteCategory(cateID);
	}
	
	@Override
	public int hideCategory(int cateID) {
		return categoryDAO.hideCategory(cateID);
	}
	
	@Override
	public int unhideCategory(int cateID) {
		return categoryDAO.unhideCategory(cateID);
	}
}
